{include file="public/header" /}
<script src="/static/ueditor/ueditor.config.js"></script>
<script src="/static/ueditor/ueditor.all.min.js"></script>
<script src="/static/ueditor/lang/zh-cn/zh-cn.js"></script>
<style>


</style>
<body>
<div class="x-body ">
    <form  class="layui-form">
        <div class="layui-form-item">
            <label for="employee_code" class="layui-form-label">客户简称 <span style="color: red">*</span></label>
            <div class="layui-input-inline">
                <input type="text" id="client_abbreviation" value=""  name="client_abbreviation" lay-verify="required" autocomplete="off" class="layui-input" >
            </div>
        </div>
        <div class="layui-form-item">
            <label for="employee_code" class="layui-form-label">客户全称</label>
            <div class="layui-input-inline">
                <input type="text" id="client_name" value=""  name="client_name" autocomplete="off" class="layui-input" >
            </div>
        </div>

        <div class="layui-form-item">
            <label for="employee_code" class="layui-form-label">负责人</label>
            <div class="layui-input-inline">
                <input type="text" id="person_in_charge" value=""  name="person_in_charge" autocomplete="off" class="layui-input" >
            </div>
        </div>

        <div class="layui-form-item">
            <label for="employee_code" class="layui-form-label">地址</label>
            <div class="layui-input-inline">
                <input type="text" id="address" value=""  name="address" autocomplete="off" class="layui-input" >
            </div>
        </div>

        <div class="layui-form-item">
            <label for="employee_code" class="layui-form-label">电话</label>
            <div class="layui-input-inline">
                <input type="text" id="tle" value=""  name="tle" autocomplete="off" class="layui-input" >
            </div>
        </div>

        <div class="layui-form-item">
            <label for="employee_code" class="layui-form-label">税法</label>
            <div class="layui-input-inline">
                <input type="text" id="taxunm" value=""  name="taxunm" autocomplete="off" class="layui-input" >
            </div>
        </div>

        <div class="layui-form-item">
            <label for="employee_code" class="layui-form-label">开户行</label>
            <div class="layui-input-inline">
                <input type="text" id="opening_bank" value=""  name="opening_bank" autocomplete="off" class="layui-input" >
            </div>
        </div>

        <div class="layui-form-item">
            <label for="employee_code" class="layui-form-label">银行卡号</label>
            <div class="layui-input-inline">
                <input type="text" id="accoun_num" value=""  name="accoun_num" autocomplete="off" class="layui-input" >
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">客户分类</label>
            <div class="layui-input-block">
                <select name="client_classify_id" >
                    <option value="1">公司</option>
                    <option value="2">个人</option>
                </select>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label"></label>
            <button class="layui-btn" lay-submit lay-filter="addId">
                增加
            </button>
        </div>
    </form>
</div>
<script>

    layui.use(['form'], function(){
        $ = layui.jquery;
        var form = layui.form,layer = layui.layer;

        //监听提交
        form.on('submit(addId)', function(data){
            console.log(data);
            $.post("{:url('index/Client/clientAdd')}",data.field,function(info){
                if (info) {
                    layer.alert("添加成功", {icon: 6},function () {
                        window.parent.location.reload();  //刷新父级页面
                        // 获得frame索引
                        var index = parent.layer.getFrameIndex(window.name);
                        //关闭当前弹出层
                        parent.layer.close(index);
                    });
                }else{
                    layer.alert("添加失败", {icon: 5});
                }
            },'json');
            return false;
        });


    });
</script>
</body>

</html>